package com.esun.cheetah.view.setting;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.RelativeLayout;

import com.esun.cheetah.R;
import com.esun.cheetah.config.Config;

public class HelpAct extends Activity implements OnClickListener {

	private Button btnBack;

	private RelativeLayout relativeAbout;
	private RelativeLayout relativeLottery;
	private RelativeLayout relativeRecharge;
	private RelativeLayout relativeExchange;
	private RelativeLayout relativeWithdraw;
	private RelativeLayout relativeRefund;
	private RelativeLayout relativeRealnameAuthentication;
	private RelativeLayout relativeBankCardError;
	private RelativeLayout relativeForget;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.help);
		initUI();
	}

	private void initUI() {
		btnBack = (Button) findViewById(R.id.option_help_list_act_btn_back);
		btnBack.setOnClickListener(this);

		relativeAbout = (RelativeLayout) findViewById(R.id.option_help_about);
		relativeAbout.setOnClickListener(this);

		relativeBankCardError = (RelativeLayout) findViewById(R.id.option_help_bank_error);
		relativeBankCardError.setOnClickListener(this);

		relativeExchange = (RelativeLayout) findViewById(R.id.option_help_exchange);
		relativeExchange.setOnClickListener(this);

		relativeForget = (RelativeLayout) findViewById(R.id.option_help_forget);
		relativeForget.setOnClickListener(this);

		relativeLottery = (RelativeLayout) findViewById(R.id.option_help_lottery);
		relativeLottery.setOnClickListener(this);

		relativeRealnameAuthentication = (RelativeLayout) findViewById(R.id.option_help_realname_authentication);
		relativeRealnameAuthentication.setOnClickListener(this);

		relativeRecharge = (RelativeLayout) findViewById(R.id.option_help_recharge);
		relativeRecharge.setOnClickListener(this);

		relativeRefund = (RelativeLayout) findViewById(R.id.option_help_refund);
		relativeRefund.setOnClickListener(this);

		relativeWithdraw = (RelativeLayout) findViewById(R.id.option_help_withdraw);
		relativeWithdraw.setOnClickListener(this);

	}

	@Override
	public void onClick(View arg0) {
		switch (arg0.getId()) {
		case R.id.option_help_about:
			startActivity(new Intent(HelpAct.this, HelpDetail.class).putExtra("url",
					Config.HELP_WEB_URL + "#0"));

			break;

		case R.id.option_help_lottery:

			startActivity(new Intent(HelpAct.this, HelpDetail.class).putExtra("url",
					Config.HELP_WEB_URL + "#1"));

			break;

		case R.id.option_help_recharge:

			startActivity(new Intent(HelpAct.this, HelpDetail.class).putExtra("url",
					Config.HELP_WEB_URL + "#2"));

			break;

		case R.id.option_help_exchange:

			startActivity(new Intent(HelpAct.this, HelpDetail.class).putExtra("url",
					Config.HELP_WEB_URL + "#3"));

			break;

		case R.id.option_help_withdraw:

			startActivity(new Intent(HelpAct.this, HelpDetail.class).putExtra("url",
					Config.HELP_WEB_URL + "#4"));

			break;

		case R.id.option_help_refund:

			startActivity(new Intent(HelpAct.this, HelpDetail.class).putExtra("url",
					Config.HELP_WEB_URL + "#5"));

			break;

		case R.id.option_help_realname_authentication:

			startActivity(new Intent(HelpAct.this, HelpDetail.class).putExtra("url",
					Config.HELP_WEB_URL + "#6"));

			break;

		case R.id.option_help_bank_error:

			startActivity(new Intent(HelpAct.this, HelpDetail.class).putExtra("url",
					Config.HELP_WEB_URL + "#7"));

			break;

		case R.id.option_help_forget:

			startActivity(new Intent(HelpAct.this, HelpDetail.class).putExtra("url",
					Config.HELP_WEB_URL + "#8"));

			break;

		case R.id.option_help_list_act_btn_back:

			HelpAct.this.finish();

			break;
		}
	}

}
